import React, { lazy, Suspense } from "react";
import { Routes, Route, Navigate } from 'react-router-dom';
import Home from '@/pages/Home'
const Search = lazy(() => import ('@/pages/Search'))
const Find = lazy(() => import ('@/pages/Find'))
const Follow = lazy(() => import ('@/pages/Follow'))
const Local = lazy(() => import ('@/pages/Local'))
const Cities = lazy(() => import ('@/pages/Cities'))

export default () => {
    return (
        <Suspense fallback={null}>
            <Routes>
                {/* <Route path="/" element={<Home/>}/> */}
                <Route path="/" element={<Navigate to="/home/find" replace={true}/>}/>
                <Route path='/home' element={<Home/>}>
                    {/* 二级路由 */}
                    <Route path='/home/find' element={<Find/>}/>
                    <Route path='/home/follow' element={<Follow/>}/>
                    <Route path='/home/local' element={<Local/>}/>
                </Route>
                <Route path="/search" element={<Search/>}></Route>
                <Route path="/cities" element={<Cities/>}></Route>
                {/* <Route path="/find" element={<Find/>}></Route> */}
                {/* <Route path="/follow" element={<Follow/>}></Route> */}
                {/* <Route path="/local" element={<Local/>}></Route> */}
            </Routes>
        </Suspense>
    )
}

  
